# -*-encoding: utf-8 -*-

#from Connection import MyThread
#a = MyThread("a")
#b = MyThread('b')
#
#a.start()
#b.start()

from MySqlPoolThread import MySqlPoolThread

def selectImpl(sql, *param):
    a = MySqlPoolThread(sql, *param)
    a.start()
    a.join()
    #for row in a.showResult():
    #    print row['ID']
    return a.showResult()

def updateImpl(sql, *param):
    a = MySqlPoolThread(sql, *param)
    a.start()
    a.join()
    return a.showAffectedRows()

def insertImpl(sql, *param):
    a = MySqlPoolThread(sql, *param)
    a.start()
    a.join()
    return a.showAffectedRows()


def deleteImpl(sql, *param):
    a = MySqlPoolThread(sql, *param)
    a.start()
    a.join()
    return a.showAffectedRows()
